{% extends "bootstrap5/admin/base.html" %}
{% block title %}访问日志{% endblock %}

{% block content %}
<h1 class="mb-4">访问日志</h1>

<div class="table-responsive">
    <table class="table table-striped">
        <thead>
            <tr>
                <th>ID</th>
                <th>IP 地址</th>
                <th>地址位置</th>
                <th>访问页面</th>
                <th>访问时间</th>
                <th>是否外网</th>
            </tr>
        </thead>
        <tbody>
            {% for log in logs %}
            <tr>
                <td>{{ log.id }}</td>
                <td>{{ log.ip }}</td>
                <td>{{ log.location }}</td>
                <td>{{ log.path }}</td>
                <td>{{ log.created_at.strftime('%Y-%m-%d %H:%M:%S') }}</td>
                <td>
                    {% if log.is_external %}
                        ✅
                    {% else %}
                        ❌
                    {% endif %}
                </td>
            </tr>
            {% endfor %}
        </tbody>
    </table>
</div>
{% endblock %}
